package com.wing.wcabinet.model.response;

import com.wing.cabinet.utils.ExcelExport;
import com.wing.product.model.entity.ProductType;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.net.URL;
import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import com.wing.wcabinet.model.entity.WcabCellSingleInventoryProduct;
import java.math.BigDecimal;

/**
 * 售刀柜sku库存(某个柜子)VO
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class WcabCellSingleInventoryProductVO {

    /**
     * ID
     */
    private Long id;

    /**
     * 创建时间
     */
    @JsonFormat(timezone = "GMT+8" , pattern = "yyyy-MM-dd HH:mm:ss" )
    private LocalDateTime createTime;

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 柜子id
     */
    private Long cabId;

    /**
     * sku id
     */
    private Long skuId;

    /**
     * 库存数量
     */
    private Integer quantity;

    /**
     * 重量
     */
    private BigDecimal weight;

    /**
     * 货道id
     */
    private Integer spaceId;

    /**
     * sku code
     */
    private String skuCode;

    /**
     * 柜子编码
     */
    private String cabCode;

    /**
     * 货道
     */
    private String spaceCode;

    /**
     * 是否已同步：no(0,未同步);yes(1,已同步);
     */
    private Integer isSyns;

    /**
     * 同步时间
     */
    @JsonFormat(timezone = "GMT+8" , pattern = "yyyy-MM-dd HH:mm:ss" )
    private LocalDateTime synsTime;

    /**
     * enterpriseId
     */
    private Long enterpriseId;

    /**
     * enterpriseCode
     */
    private String enterpriseCode;

    /**
     * 业务类型
     */
    private WcabCellSingleInventoryProduct.BusinessType businessType;

    /**
    * 业务类型描述
    */
    @TableField(exist = false)
    private String businessTypeDesc;

    public String getBusinessTypeDesc() {
        if (businessType!=null){
            return businessType.getDesc();
        }
        return "";

    }


    /**
     * sku 名称
     */
    @ExcelExport(value = "物料名称",sort = 2)
    private String skuName;

    /**
     * sku 规格
     */
    @ExcelExport(value = "规格码",sort = 5)
    private String skuSpec;

    /**
     * sku 图片
     */

    private String skuPic;
    //@ExcelExport(value = "产品图片",sort = 1)
    private URL skuPicVo;
    /**
     * 产品名称
     */
    private String productName;

    /**
     * 产品类型名称
     */
    private String productTypeName;

    /**
     * 产品分类名称
     */
    private String productCategoryName;

    /**
     * 产品品牌
     */
    @ExcelExport(value = "品牌",sort = 5)
    private String productBrandName;



    private Integer quantityTemp;
    private Integer quantityRepair;

    private Integer quantityRecycle;

    private Integer cabNum;

    private Integer spaceNum;


    /**
     * 市场价
     */
    private BigDecimal marketPrice;

    private Integer quantityMax;

    /**
     * 单位
     */
    @ExcelExport(value = "单位",sort = 9)
    private String unitName;

    @ExcelExport(value = "规格码",sort = 4)
    private String skuSpecOld;

    private String skuCodeOld;


    private BigDecimal weightTemp;

    private BigDecimal weightRepair;

    private BigDecimal weightRecycle;

    private Integer quantitySetting;
    private BigDecimal weightSetting;

    private String belongCabinet;

    private String cabName;


    /**
     * 当前库存
     */
    private Long curentStock;

    /**
     * 告警库存
     */
    private Long alarmStock;

    /**
     * 计划补货
     */
    private Long planReplenishment;

    /**
     * 建议补货
     */
    private Long proposalStock;



    private BigDecimal baseWeight;

    private String weightUnitName;

    private ProductType.WeightUnit weightUnit;


    public String getWeightUnitName(){
        if (this.weightUnit!=null){
            return this.weightUnit.getDesc();
        }
        return "";
    }

    private BigDecimal skuWeightUnit;



    private String weightUnitDesc;

    public String getWeightUnitDesc(){
        if (this.weightUnit!=null){
            return this.weightUnit.getDesc();
        }
        return "";
    }



    private String quantityUnitDesc;

    public String getQuantityUnitDesc(){
        return this.unitName;
    }

}
